package com.aspose.cells.a.d;

import com.aspose.cells.Color;
import java.util.HashMap;

public class zbb {
   private static byte[] a = com.aspose.cells.a.c.zv.d();
   private static HashMap b = new HashMap();
   private static Object c = new Object();

   public static byte[] a(com.aspose.cells.b.a.b.a.zg var0) throws Exception {
      String var1 = c(var0);
      Object var3 = c;
      byte[] var2;
      synchronized(c) {
         var2 = (byte[])((byte[])b.get(var1));
      }

      if (var2 == null) {
         var3 = c;
         synchronized(c) {
            var2 = (byte[])((byte[])b.get(var1));
            if (var2 == null) {
               var2 = b(var0);
               b.put(var1, var2);
            }
         }
      }

      return var2;
   }

   private static byte[] b(com.aspose.cells.b.a.b.a.zg var0) throws Exception {
      byte[] var1 = new byte[8];
      System.arraycopy(a, var0.d() * 8, var1, 0, 8);
      com.aspose.cells.a.c.zd var2 = new com.aspose.cells.a.c.zd(8, 8);

      try {
         for(int var3 = 0; var3 < 8; ++var3) {
            for(int var4 = 0; var4 < 8; ++var4) {
               Color var5 = (var1[var3] & 255 & 128 >> var4) > 0 ? var0.c() : var0.b();
               var2.a(var4, 7 - var3, var5);
            }
         }

         com.aspose.cells.b.a.d.zh var9 = new com.aspose.cells.b.a.d.zh();
         var2.a(var9, 5);
         byte[] var10 = com.aspose.cells.a.c.zw.a(var9, false);
         return var10;
      } finally {
         if (var2 != null) {
            var2.a();
         }

      }
   }

   private static String c(com.aspose.cells.b.a.b.a.zg var0) {
      return com.aspose.cells.b.a.zv.a("{0}{1}{2}", var0.d(), com.aspose.cells.a.c.zp.d(var0.b().toArgb()), com.aspose.cells.a.c.zp.d(var0.c().toArgb()));
   }
}
